<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.pro.bean.Groups " %>
<%@ page import="com.wangle.dao.GroupImpl " %>
<%@ page import="java.util.ArrayList;" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'groupTop.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	<link href="css/bootstrap.css" rel="stylesheet">
	<link rel="stylesheet" href="css/main.css">

	<script src="js/jquery.js"></script>
	<script src="js/bootstrap.min.js"></script>

	<title>分组管理表头</title>
	
<script type="text/javascript">

   $("document").ready(function(){
   $("#reupdate").click(function(){
    if($("#groupname").val()==""){
    alert("请输入组名！！！");
  }else if($("#groupname").val()=="你好吗"){
     alert("组名重复，请重新输入！！！");
  }else{ 
     $.ajax({
    type:"post",
    url:"GroupServlet?status=reJsp",
    data:$("#formtop").serialize(),
    success:function(datas){
    // alert(datas);
    //$("#divtop").html(datas);
   //parent.frames["left"].location.reload();
  // window.location.replace('groupLeft.jsp');
    }    
    });
    }//else
});  
});
 function Jupm(){	
      var flag=window.confirm("确定？"); 
      if(flag==true){	
	  window.location.href="jsp/grouLeft.jsp?";
	     }
		}
</script>
</head>
<%
	Groups gs=new Groups();
	GroupImpl gsi=new GroupImpl();
    int groupid=Integer.valueOf(request.getParameter("groupid"));
    request.setAttribute("groupid", groupid);
     
  	gs.setGroupid(groupid);
  	gsi.queryByID(groupid);
  	
  	
 %>
<body>
<form method="post" action="GroupServlet" name="formtop" target="left" id="formtop">
	<div id="divtop" style="width:900px">
		<div style="width:400px;float:left">
		    <p><font size="2"><strong>组信息</strong></font></p>	
		    <input type="hidden" id="groupid" name="groupid" value="<%=gs.getGroupid() %>" ></input>
			<p> 父组：<input type="text" id="prgroupid" name="prgroupid" value="<%=gs.getPrgroupid()%>"/></p>
			<p> 组名：<input type="text" id="groupname" name="groupname" value="<%=gs.getGroupname() %>"/>
			</p>
			<p>
			<span>组说明: </span><input type="text" id="groupnote"  name="groupnote" value="<%=gs.getGroupnote() %>"/>
			</p>
			<input type="submit"class="btn btn-info btn-xs"name="reupdate" id="reupdate" value="确认修改"/>
	      </div>
        </div>
	</form>
</body>
</html>
